package net.oschina.j2cache;

import lombok.extern.slf4j.Slf4j;

/** 用来测试缓存的有效期 */
@Slf4j
public class ExpiredTester {

  public static void main(String[] args) throws InterruptedException {
    CacheChannel cache = J2Cache.getChannel();

    cache.set("default", "name", "Winter Lau");

    for (int i = 1; i <= 20; i++) {
      log.info("{}: {}}\n", i, cache.get("default", "name"));
      Thread.sleep(1000);
    }

    cache.close();
  }
}
